<?
 $client_data = array('name' => 'Имя',
                      'phone' => 'Телефон',
                      'email' => 'Электронная почта',
                      'address' => 'Адрес');
?>

<style type="text/css">
    h1 {font:24px Tahoma; color:#222; padding:15px; margin-bottom:15px; background:#E0E0E0}
    p {color:#333; font:14px Tahoma;}
    a {color:#35a2ff; font:14px Tahoma; text-decoration:none; border-bottom:1px dotted #35a2ff}    
    div {background:#EEE; padding:10px;}
    span {display:inline-block; background:#D6D6D6; padding:5px 10px; text-align:right; width:140px; margin-bottom:1px; margin-right:5px;}
    table {width:100%; color:#333; font:14px Tahoma;}
    table th {background:#D6D6D6; padding:5px 10px; text-align: center;}
    table td {border-bottom:1px solid #D6D6D6; padding:5px 10px; text-align: right;}
</style>

<div>
    <h1>Заказ товара</h1>
    <p>Данные по заказу</p>
    <table>
      <tr><th>№</th>
          <th>Название</th>
          <th>Цена</th>
          <th>Количество</th>
          <th>Сумма</th>
      </tr>
 
 <?
    $i = 1;
    $quantity = 0;
    $total = 0;
    foreach($data['product'] as $key => $value){
        $quantity += $value['quantity'];
        $total += $value['price']*$value['quantity'];
        echo "<tr><td>$i</td>
                  <td>{$value['name']}</td>
                  <td>{$value['price']}</td>
                  <td>{$value['quantity']}</td>
                  <td>".$value['price']*$value['quantity']."</td>
              </tr>";
        $i++;
    }
    echo "<tr><td></td>
                  <td></td>
                  <td></td>
                  <td>$quantity</td>
                  <td>$total</td>
              </tr>";
    echo "</table>";
?>

    <p>Данные по клиенту</p>
    <table>
        <tr>
            <th>Имя</th>
            <th>Телефон</th>
            <th>email</th>
            <th>Адрес</th>
        </tr>
        <tr>
            <td><?= $data['client']['name'] ?></td>
            <td><?= $data['client']['phone'] ?></td>
            <td><?= $data['client']['email'] ?></td>
            <td><?= $data['client']['address'] ?></td>
        </tr>
    </table>
    
    <br/>    
    <p>Отправлено: <?= date("H:i d.m.Y") ?></p>
    <br/>
</div>